package com.sdr.hkcamera.data;

import com.hikvision.vmsnetsdk.CameraInfo;
import com.hikvision.vmsnetsdk.ControlUnitInfo;
import com.hikvision.vmsnetsdk.RegionInfo;

/**
 * Created by homelajiang on 2016/9/27 0027.
 */

public class Node {
    //0 未知 1 控制中心 2 组织 3 摄像头
    public static final int NODE_UNKNOW = 0;
    public static final int NODE_UNIT = 1;
    public static final int NODE_REGION = 2;
    public static final int NODE_CAMERA = 3;

    int id;
    int level;
    int type;
    int parentId;
    boolean open;
    Object rawData;

    public Node() {
    }

    public Node(ControlUnitInfo info, int level, int parentId) {
        this.rawData = info;
        this.level = level;
        this.type = NODE_UNIT;
        this.parentId = parentId;
        this.id = Integer.parseInt(info.getControlUnitID());
    }

    public Node(RegionInfo info, int level, int parentId) {
        this.rawData = info;
        this.level = level;
        this.type = NODE_REGION;
        this.parentId = parentId;
        this.id = Integer.parseInt(info.getRegionID());
    }

    public Node(CameraInfo info, int level, int parentId) {
        this.rawData = info;
        this.level = level;
        this.type = NODE_CAMERA;
        this.parentId = parentId;
        this.id = Integer.parseInt(info.getId());
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getParentId() {
        return parentId;
    }

    public void setParentId(int parentId) {
        this.parentId = parentId;
    }

    public boolean isOpen() {
        return open;
    }

    public void setOpen(boolean open) {
        this.open = open;
    }

    public Object getRawData() {
        return rawData;
    }

    public void setRawData(Object rawData) {
        this.rawData = rawData;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }
}
